<include file="Public/header" title="分类列表" />

<div id="page-wrapper">
    
    <div class="row">
        <div class="col-md-6">
            <a href="{:U('demos/add')}" class="btn btn-success">添加案例</a>
        </div>
        <div class="col-md-6">
            <form action="{:U('demos/index')}" method="post">
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="key" placeholder="输入分类标题搜索">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                    </span>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-hover table-striped">
        <thead>
            <tr>
                <th style="text-align: center">编号</th>
                <th style="width:30%;text-align: center;vertical-align: middle">标题</th>
                <th style="width:30%;text-align: center;vertical-align: middle">图片</th>
                <th style="text-align: center">状态</th>
                <th style="text-align: center">操作</th>
            </tr>
        </thead>
        <tbody>
        <foreach name="list" item="v">
            <tr>
                <td style="display: table-cell;vertical-align: middle;text-align: center;">{$v.id}</td>
                <td style="display: table-cell;vertical-align: middle;text-align: center;">{$v.title}</td>
                <td style="width:30%;text-align: center;display: table-cell;vertical-align: middle"><img src="{:C('DEMOS_PATH')}{$v.image}" style="width:80%;height:auto;vertical-align:middle;"></td>
                <td style="display: table-cell;vertical-align: middle;text-align: center;"><if condition="$v[status] eq 1 ">启用中<else /> 已禁用</if></td>
                <td style="display: table-cell;vertical-align: middle;text-align: center;"><a href="{:U('demos/update?id=')}{$v.id}">编辑</a> | <a href="{:U('demos/delete?id=')}{$v.id}" style="color:red;" onclick="javascript:return del('您真的确定要删除吗？\n\n删除后将不能恢复!');">删除</a></td>
            </tr>
        </foreach>
        </tbody>
    </table>
    {$page}
</div>


<include file="Public/footer" />